package com.allst.rmi.demo;

import com.allst.rmi.pojo.User;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

/**
 * @author June
 * @since 2021年02月
 */
public class HelloServiceImpl extends UnicastRemoteObject implements IHelloService {
    // 手动实现父类的构造方法
    public HelloServiceImpl() throws RemoteException {
        super();
    }

    @Override
    public String sayHello(User user) throws RemoteException {
        System.out.println("this is server, say hello to " + user.getUsername());
        return "success";
    }
}
